package com.lse_api.entity;

import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 项目内部API接口
 * </p>
 *
 * @author 祁雪
 * @since 2020-05-11
 */
@Getter
@Setter
public class ProjectApi implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 项目ID
     */
    private Integer projectId;

    /**
     * api地址
     */
    private String url;

    /**
     * 接口名称
     */
    private String name;

    /**
     * 请求方式 post等
     */
    private String method;

    /**
     * 请求成功回调
     */
    private String success;

    /**
     * 请求失败回调
     */
    private String failure;

    /**
     * 备注
     */
    private String note;

    /**
     * api创建者
     */
    private String apiCreate;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * api最后一次修改者
     */
    private String apiUpdate;

    /**
     * 修改日期
     */
    private Date updateTime;

    /**
     * api创建者名称
     */
    @TableField(exist = false)
    private String apiCreateName;
    /**
     * api最后一次修改者名称
     */
    @TableField(exist = false)
    private String apiUpdateName;

    /**
     * api接口参数列表(导出PDF用)
     */
    @TableField(exist = false)
    private List<ProjectApiParpam> params;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    public String getFailure() {
        return failure;
    }

    public void setFailure(String failure) {
        this.failure = failure;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getApiCreate() {
        return apiCreate;
    }

    public void setApiCreate(String apiCreate) {
        this.apiCreate = apiCreate;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getApiUpdate() {
        return apiUpdate;
    }

    public void setApiUpdate(String apiUpdate) {
        this.apiUpdate = apiUpdate;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "ProjectApi{" +
                "id=" + id +
                ", projectId=" + projectId +
                ", url=" + url +
                ", name=" + name +
                ", method=" + method +
                ", success=" + success +
                ", failure=" + failure +
                ", note=" + note +
                ", apiCreate=" + apiCreate +
                ", createTime=" + createTime +
                ", apiUpdate=" + apiUpdate +
                ", updateTime=" + updateTime +
                "}";
    }
}
